﻿using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;
using ElectronicCommerce.Framework.Collections;

namespace ElectronicCommerce.Framework.Utility.Mail.Enitity
{
    /// <summary>
    /// Mail Info
    /// </summary>
    [DataContract]
    public class MailInfo : IKeyedObject
    {
        public MailInfo()
        {
            this.ID = 0;
            this.From = string.Empty;
            this.DisplayName = string.Empty;
            this.Subject = string.Empty;
            this.Body = string.Empty;
            this.ContextEncode = Encoding.UTF8;
            this.IsHtml = false;
            this.To = new List<string>();
            this.CC = new List<string>();
            this.Bcc = new List<string>();
        }

        #region Mail address

        [DataMember]
        public string From { get; set; }

        [DataMember]
        public string DisplayName { get; set; }

        [DataMember]
        public List<string> To { get; set; }

        [DataMember]
        public List<string> CC { get; set; }

        [DataMember]
        public List<string> Bcc { get; set; }

        #endregion

        #region Mail context

        [DataMember]
        public bool IsHtml { get; set; }

        [DataMember]
        public string Subject { get; set; }

        [DataMember]
        public string Body { get; set; }

        [DataMember]
        public Encoding ContextEncode { get; set; }

        #endregion

        #region IKeyedObject Members

        public int ID { get; set; }

        public string Key
        {
            get
            {
                return ID.ToString();
            }
        }

        #endregion
    }
}
